package xcmg.device.dao.mapper.warehouse;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.warehouse.WarehouseInboundDO;
import xcmg.device.dao.entity.warehouse.export.WarehouseInboundExportDO;
import xcmg.device.service.vo.warehouse.WarehouseInboundVO;

import java.util.List;

@Mapper
public interface WarehouseInboundMapper {
    int insert(WarehouseInboundDO record);

    WarehouseInboundDO selectByPrimaryKey(String id);

    List<WarehouseInboundDO> list(WarehouseInboundVO model);

    int deleteByPK(String id);

    int updateByPrimaryKeySelective(WarehouseInboundDO model);

    List<String> findOrderList(@Param("ids") List<String> ids);

    List<String> findIdsByBusinessOrders(@Param("businessOrders") List<String> businessOrders, @Param("orgId") String orgId);

    int remove(@Param("ids") List<String> ids);

    WarehouseInboundDO selectByOrder(@Param("businessOrder") String businessOrder, @Param("orgId") String orgId);

    int findCountForExport(@Param("ids") List<String> ids);

    List<WarehouseInboundExportDO> findListForExport(@Param("ids") List<String> ids);

    int findCountForExportAll(WarehouseInboundVO model);

    List<WarehouseInboundExportDO> findListForExportAll(WarehouseInboundVO model);

    int updateStateNoBarcode(@Param("status") Integer status, @Param("businessOrder") String businessOrder, @Param("orgId") String orgId);
    
    int getInvalidCountByBusinessOrder(String businessOrder);
    
    int deleteByInboundOrder(@Param("businessOrder") String businessOrder, @Param("orgId") String orgId);
    
    int updateInboundToValid(@Param("businessOrder") String businessOrder, @Param("userId") String userId, @Param("orgId") String orgId, @Param("userName") String userName);
}